//
//  UIViewController+NXSegementController.m
//  NXScrollPageView
//
//  Created by N-X on 2018/3/26.
//  Copyright © 2018年 MRNAN. All rights reserved.
//

#import "UIViewController+NXSegementController.h"
#import <objc/runtime.h>

@implementation UIViewController (NXSegementController)
static const  char currentIndexKey;

- (void)setNx_currentIndex:(NSInteger)nx_currentIndex
{
    objc_setAssociatedObject(self, &currentIndexKey, [NSNumber numberWithInteger:nx_currentIndex], OBJC_ASSOCIATION_ASSIGN);
}

- (NSInteger)nx_currentIndex
{
    return [objc_getAssociatedObject(self, &currentIndexKey) integerValue];
}

@end
